<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>Hexo + Gitee 博客搭建 | 小辉的博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="一、环境准备注册码云账号： https:&#x2F;&#x2F;gitee.com&#x2F;下载安装 Git： https:&#x2F;&#x2F;git-scm.com&#x2F;downloads下载安装 Nodejs：http:&#x2F;&#x2F;nodejs.cn&#x2F;download&#x2F;安装 Hexo：npm install hexo-cli -g 二、博客相关hexo 官方文档：https:&#x2F;&#x2F;hexo.io&#x2F;zh-cn&#x2F;docs&#x2F; 三、初始化hexo init">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo + Gitee 博客搭建">
<meta property="og:url" content="http://example.com/2020/01/01/Hexo%20+%20Gitee%20%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/index.html">
<meta property="og:site_name" content="小辉的博客">
<meta property="og:description" content="一、环境准备注册码云账号： https:&#x2F;&#x2F;gitee.com&#x2F;下载安装 Git： https:&#x2F;&#x2F;git-scm.com&#x2F;downloads下载安装 Nodejs：http:&#x2F;&#x2F;nodejs.cn&#x2F;download&#x2F;安装 Hexo：npm install hexo-cli -g 二、博客相关hexo 官方文档：https:&#x2F;&#x2F;hexo.io&#x2F;zh-cn&#x2F;docs&#x2F; 三、初始化hexo init">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-01-01T13:16:33.000Z">
<meta property="article:modified_time" content="2021-02-02T09:09:12.362Z">
<meta property="article:author" content="Linxh">
<meta property="article:tag" content="网站">
<meta property="article:tag" content="博客">
<meta property="article:tag" content="教程">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="小辉的博客" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 5.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">小辉的博客</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">三人行，必有我师</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS 订阅"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="搜索"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://example.com"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-Hexo + Gitee 博客搭建" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2020/01/01/Hexo%20+%20Gitee%20%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" class="article-date">
  <time class="dt-published" datetime="2020-01-01T13:16:33.000Z" itemprop="datePublished">2020-01-01</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/">网站建设</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      Hexo + Gitee 博客搭建
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <p>一、环境准备<br>注册码云账号： <a target="_blank" rel="noopener" href="https://gitee.com/">https://gitee.com/</a><br>下载安装 Git： <a target="_blank" rel="noopener" href="https://git-scm.com/downloads">https://git-scm.com/downloads</a><br>下载安装 Nodejs：<a target="_blank" rel="noopener" href="http://nodejs.cn/download/">http://nodejs.cn/download/</a><br>安装 Hexo：npm install hexo-cli -g</p>
<p>二、博客相关<br>hexo 官方文档：<a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/">https://hexo.io/zh-cn/docs/</a></p>
<p>三、初始化<br>hexo init blog<br>cd blog<br>npm install<br>npm install hexo-deployer-git –save<br>hexo s  本地服务开启<br>hexo g 生成缓存文件和静态文件<br>hexo clean 清楚缓存<br>hexo d 推送到Git仓库部署网站</p>
<p>四、配置git<br>1、在码云上创建一个仓库，仓库名称随意起，但【路径名称必须与你的用户名】相同，是否开源选择公开，其他不用管，确认创建即可<br>2、修改配置<br>选择SSH，有一个 <a href="mailto:&#103;&#x69;&#x74;&#64;&#103;&#x69;&#116;&#x65;&#x65;&#x2e;&#x63;&#x6f;&#x6d;">&#103;&#x69;&#x74;&#64;&#103;&#x69;&#116;&#x65;&#x65;&#x2e;&#x63;&#x6f;&#x6d;</a>:你的用户名/你的用户名.git 的链接，将其复制到本地你的博客根目录下的 _config.yml 文件中的对应位置后保存<br>deploy:<br>  type: git<br>  repo: 【<a href="mailto:&#103;&#x69;&#116;&#x40;&#103;&#x69;&#x74;&#x65;&#x65;&#x2e;&#x63;&#x6f;&#x6d;">&#103;&#x69;&#116;&#x40;&#103;&#x69;&#x74;&#x65;&#x65;&#x2e;&#x63;&#x6f;&#x6d;</a>:你的用户名/你的用户名.git】复制到这里<br>  branch: master<br>3、设置SSH KEY，若已添加可跳过。<br>打开Git GUI,Help - Show SSH Key - Generate Key,然后将公钥添加到码云。</p>
<p>五、编写<br>在blog\source_posts下创建md文件编写；也可以hexo new 文件名;<br>图片问题，<a target="_blank" rel="noopener" href="https://www.jianshu.com/p/950f8f13a36c">https://www.jianshu.com/p/950f8f13a36c</a></p>
<p>六、部署<br>1、生成部署文件<br>hexo clean<br>hexo g<br>hexo g -d  //上传到远程在码云上的仓库<br>2、登录码云账户，打开和自己用户名相同的仓库, 点击服务，打开giteePages，点击开启。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://example.com/2020/01/01/Hexo%20+%20Gitee%20%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" data-id="ckkp5cu6500016cqsbd6kfe94" data-title="Hexo + Gitee 博客搭建" class="article-share-link">分享</a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%8D%9A%E5%AE%A2/" rel="tag">博客</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%99%E7%A8%8B/" rel="tag">教程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E7%BD%91%E7%AB%99/" rel="tag">网站</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/09/09/example/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">前一篇</strong>
      <div class="article-nav-title">
        
          使用Hexo搭建博客(上)-建站,配置与部署
        
      </div>
    </a>
  
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/">网站建设</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/minio/" rel="tag">minio</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%8D%9A%E5%AE%A2/" rel="tag">博客</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%95%99%E7%A8%8B/" rel="tag">教程</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%BD%91%E7%AB%99/" rel="tag">网站</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签云</h3>
    <div class="widget tagcloud">
      <a href="/tags/minio/" style="font-size: 10px;">minio</a> <a href="/tags/%E5%8D%9A%E5%AE%A2/" style="font-size: 20px;">博客</a> <a href="/tags/%E6%95%99%E7%A8%8B/" style="font-size: 20px;">教程</a> <a href="/tags/%E7%BD%91%E7%AB%99/" style="font-size: 20px;">网站</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/02/">二月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/09/">九月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">一月 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/02/02/test/">test</a>
          </li>
        
          <li>
            <a href="/2021/02/02/%E5%AF%B9%E8%B1%A1%E5%AD%98%E5%82%A8/minio/minio%E5%9C%A8%E7%BA%BF%E9%A2%84%E8%A7%88/">minio在线预览</a>
          </li>
        
          <li>
            <a href="/2021/02/02/mytest/">mytest</a>
          </li>
        
          <li>
            <a href="/2021/02/02/hello-world/">Hello World</a>
          </li>
        
          <li>
            <a href="/2020/09/09/example/">使用Hexo搭建博客(上)-建站,配置与部署</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2021 Linxh<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/js/jquery-3.4.1.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>